﻿using HuaHan.WorkTicket.Domain.Model;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HuaHan.WorkTicket.Domain.Repositories.EntityFramework
{
    public class DatabaseInitializer:DropCreateDatabaseIfModelChanges<WorkTicketDBContext> 
    {
        protected override void Seed(WorkTicketDBContext context)
        {

            #region color

            Color color = new Color();
            color.ColorID = Guid.NewGuid();
            color.Name = "红色";
            color.Description = "男士，女士，童装";
            color.CreatedBy = "system";
            color.UpdatedBy = "system";
            context.Colors.Add(color);

            Color color01 = new Color();
            color01.ColorID = Guid.NewGuid();
            color01.Name = "黑色";
            color01.Description = "男士，女士，童装";
            color01.CreatedBy = "system";
            color01.UpdatedBy = "system";
            context.Colors.Add(color01);

            Color color02 = new Color();
            color02.ColorID = Guid.NewGuid();
            color02.Name = "蓝色";
            color02.Description = "男士，女士，童装";
            color02.CreatedBy = "system";
            color02.UpdatedBy = "system";
            context.Colors.Add(color02);

            Color color03 = new Color();
            color03.ColorID = Guid.NewGuid();
            color03.Name = "青色";
            color03.Description = "男士，女士，童装";
            color03.CreatedBy = "system";
            color03.UpdatedBy = "system";
            context.Colors.Add(color03);

            Color color04 = new Color();
            color04.ColorID = Guid.NewGuid();
            color04.Name = "灰色";
            color04.Description = "男士，女士，童装";
            color04.CreatedBy = "system";
            color04.UpdatedBy = "system";
            context.Colors.Add(color04);


            Color color05 = new Color();
            color05.ColorID = Guid.NewGuid();
            color05.Name = "米色";
            color05.Description = "男士，女士，童装";
            color05.CreatedBy = "system";
            color05.UpdatedBy = "system";
            context.Colors.Add(color05);


            Color color06 = new Color();
            color06.ColorID = Guid.NewGuid();
            color06.Name = "绿色";
            color06.Description = "男士，女士，童装";
            color06.CreatedBy = "system";
            color06.UpdatedBy = "system";
            context.Colors.Add(color06);

            Color color07 = new Color();
            color07.ColorID = Guid.NewGuid();
            color07.Name = "黄色";
            color07.Description = "男士，女士，童装";
            color07.CreatedBy = "system";
            color07.UpdatedBy = "system";
            context.Colors.Add(color07);

            #endregion

            #region 初始化部门
            Department deparment = new Department();
            deparment.DepartmentID = Guid.NewGuid();
            deparment.IsTop = true;
            deparment.Name = "华瀚科技";
            deparment.ParentID = Guid.Parse("00000000-0000-0000-0000-000000000000");
            deparment.IsDeleted = false;
            deparment.IsValid = true;
            deparment.Remark = string.Empty;
            deparment.UpdatedAt = DateTime.Now;
            deparment.CreatedBy = "system";
            deparment.UpdatedBy = "system";
            deparment.Phone = "021-38729085";
            deparment.Description = "华瀚科技有限公司";

            context.Departments.Add(deparment);

            #endregion

            #region 菜单初始化

            Menu menu01 = new Menu();
            menu01.MenuID = Guid.NewGuid();
            menu01.Name = "Main";
            menu01.SortOrder = 0;
            menu01.ParentMenuID = Guid.Parse("00000000-0000-0000-0000-000000000000");
            menu01.IsDeleted = false;
            menu01.IsValid = true;
            menu01.Remark = string.Empty;
            menu01.UpdatedAt = DateTime.Now;
            menu01.CreatedBy = "system";
            menu01.UpdatedBy = "system";

            context.Menus.Add(menu01);

            Menu menu0101 = new Menu();
            menu0101.MenuID = Guid.NewGuid();
            menu0101.Name = "Dashboard";
            menu0101.ParentMenuID = menu01.MenuID;
            menu0101.Action = "Index";
            menu0101.Controller = "Home";
            menu0101.Ico = "icon-home";
            menu0101.IsValid = true;
            menu0101.IsDeleted = false;
            menu0101.IsValid = true;
            menu0101.Remark = string.Empty;
            menu0101.UpdatedAt = DateTime.Now;
            menu0101.CreatedBy = "system";
            menu0101.UpdatedBy = "system";

            context.Menus.Add(menu0101);

            Menu menu02 = new Menu();
            menu02.MenuID = Guid.NewGuid();
            menu02.Name = "系统设置";
            menu02.IsValid = true;
            menu02.SortOrder = 4;
            menu02.ParentMenuID = Guid.Parse("00000000-0000-0000-0000-000000000000");
            menu02.IsValid = true;
            menu02.IsDeleted = false;
            menu02.IsValid = true;
            menu02.Remark = string.Empty;
            menu02.UpdatedAt = DateTime.Now;
            menu02.CreatedBy = "system";
            menu02.UpdatedBy = "system";
            context.Menus.Add(menu02);


            Menu menu0201 = new Menu();
            menu0201.MenuID = Guid.NewGuid();
            menu0201.Name = "菜单管理";
            menu0201.ParentMenuID = menu02.MenuID;
            menu0201.Action = "MenuList";
            menu0201.Controller = "Menu";
            menu0201.Ico = "icon-th-list";
            menu0201.IsValid = true;
            menu0201.IsValid = true;
            menu0201.IsDeleted = false;
            menu0201.IsValid = true;
            menu0201.Remark = string.Empty;
            menu0201.UpdatedAt = DateTime.Now;
            menu0201.CreatedBy = "system";
            menu0201.UpdatedBy = "system";
            context.Menus.Add(menu0201);

            Menu menu0202 = new Menu();
            menu0202.MenuID = Guid.NewGuid();
            menu0202.Name = "用户组设置";
            menu0202.ParentMenuID = menu02.MenuID;
            menu0202.Action = "Index";
            menu0202.Controller = "Group";
            menu0202.Ico = "icon-th-list";
            menu0202.IsValid = true;
            menu0202.IsValid = true;
            menu0202.IsDeleted = false;
            menu0202.IsValid = true;
            menu0202.Remark = string.Empty;
            menu0202.UpdatedAt = DateTime.Now;
            menu0202.CreatedBy = "system";
            menu0202.UpdatedBy = "system";
            context.Menus.Add(menu0202);



            Menu menu03 = new Menu();
            menu03.MenuID = Guid.NewGuid();
            menu03.Name = "基础数据";
            menu03.IsValid = true;
            menu03.SortOrder = 3;
            menu03.ParentMenuID = Guid.Parse("00000000-0000-0000-0000-000000000000");
            menu03.IsValid = true;
            menu03.IsDeleted = false;
            menu03.IsValid = true;
            menu03.Remark = string.Empty;
            menu03.UpdatedAt = DateTime.Now;
            menu03.CreatedBy = "system";
            menu03.UpdatedBy = "system";
            context.Menus.Add(menu03);


            Menu menu0300= new Menu();
            menu0300.MenuID = Guid.NewGuid();
            menu0300.Name = "单位设定";
            menu0300.ParentMenuID = menu03.MenuID;
            menu0300.Action = "Index";
            menu0300.Controller = "Unit";
            menu0300.Ico = "icon-adjust";
            menu0300.SortOrder = 0;
            menu0300.IsDeleted = false;
            menu0300.IsValid = true;
            menu0300.Remark = string.Empty;
            menu0300.UpdatedAt = DateTime.Now;
            menu0300.CreatedBy = "system";
            menu0300.UpdatedBy = "system";
            context.Menus.Add(menu0300);

            Menu menu0301 = new Menu();
            menu0301.MenuID = Guid.NewGuid();
            menu0301.Name = "颜色设定";
            menu0301.ParentMenuID = menu03.MenuID;
            menu0301.Action = "Index";
            menu0301.Controller = "Color";
            menu0301.Ico = "icon-adjust";
            menu0301.SortOrder = 1;
            menu0301.IsDeleted = false;
            menu0301.IsValid = true;
            menu0301.Remark = string.Empty;
            menu0301.UpdatedAt = DateTime.Now;
            menu0301.CreatedBy = "system";
            menu0301.UpdatedBy = "system";
            context.Menus.Add(menu0301);

            Menu menu0308 = new Menu();
            menu0308.MenuID = Guid.NewGuid();
            menu0308.Name = "颜色组设定";
            menu0308.ParentMenuID = menu03.MenuID;
            menu0308.Action = "Index";
            menu0308.Controller = "ColorGroup";
            menu0308.Ico = "icon-adjust";
            menu0308.SortOrder = 1;
            menu0308.IsDeleted = false;
            menu0308.IsValid = true;
            menu0308.Remark = string.Empty;
            menu0308.UpdatedAt = DateTime.Now;
            menu0308.CreatedBy = "system";
            menu0308.UpdatedBy = "system";
            context.Menus.Add(menu0308);


            Menu menu0305 = new Menu();
            menu0305.MenuID = Guid.NewGuid();
            menu0305.Name = "尺码设置";
            menu0305.ParentMenuID = menu03.MenuID;
            menu0305.Action = "Index";
            menu0305.Controller = "Size";
            menu0305.Ico = "icon icon-color icon-suitcase";
            menu0301.SortOrder = 2;
            menu0305.IsDeleted = false;
            menu0305.IsValid = true;
            menu0305.Remark = string.Empty;
            menu0305.UpdatedAt = DateTime.Now;
            menu0305.CreatedBy = "system";
            menu0305.UpdatedBy = "system";
            context.Menus.Add(menu0305);


            Menu menu0206 = new Menu();
            menu0206.MenuID = Guid.NewGuid();
            menu0206.Name = "尺码组设置";
            menu0206.ParentMenuID = menu03.MenuID;
            menu0206.Action = "Index";
            menu0206.Controller = "SizeGroup";
            menu0206.SortOrder = 2;
            menu0206.Ico = "icon-th-list";
            menu0206.IsValid = true;
            menu0206.IsValid = true;
            menu0206.IsDeleted = false;
            menu0206.IsValid = true;
            menu0206.Remark = string.Empty;
            menu0206.UpdatedAt = DateTime.Now;
            menu0206.CreatedBy = "system";
            menu0206.UpdatedBy = "system";
            context.Menus.Add(menu0206);


            Menu menu0303 = new Menu();
            menu0303.MenuID = Guid.NewGuid();
            menu0303.Name = "款式分类";
            menu0303.ParentMenuID = menu03.MenuID;
            menu0303.Action = "Index";
            menu0303.Controller = "StyleCategory";
            menu0303.Ico = "icon icon-color icon-image";
            menu0301.SortOrder = 3;
            menu0303.IsDeleted = false;
            menu0303.IsValid = true;
            menu0303.Remark = string.Empty;
            menu0303.UpdatedAt = DateTime.Now;
            menu0303.CreatedBy = "system";
            menu0303.UpdatedBy = "system";
            context.Menus.Add(menu0303);

            Menu menu0304 = new Menu();
            menu0304.MenuID = Guid.NewGuid();
            menu0304.Name = "标准款式";
            menu0304.ParentMenuID = menu03.MenuID;
            menu0304.Action = "Index";
            menu0304.Controller = "Style";
            menu0304.Ico = "icon icon-color icon-scissors";
            menu0301.SortOrder = 4;
            menu0304.IsDeleted = false;
            menu0304.IsValid = true;
            menu0304.Remark = string.Empty;
            menu0304.UpdatedAt = DateTime.Now;
            menu0304.CreatedBy = "system";
            menu0304.UpdatedBy = "system";
            context.Menus.Add(menu0304);


           

            Menu menu0302 = new Menu();
            menu0302.MenuID = Guid.NewGuid();
            menu0302.Name = "客户管理";
            menu0302.ParentMenuID = menu03.MenuID;
            menu0302.Action = "Index";
            menu0302.Controller = "Customer";
            menu0302.Ico = "icon icon-color icon-users";
            menu0301.SortOrder = 5;
            menu0302.IsDeleted = false;
            menu0302.IsValid = true;
            menu0302.Remark = string.Empty;
            menu0302.UpdatedAt = DateTime.Now;
            menu0302.CreatedBy = "system";
            menu0302.UpdatedBy = "system";
            context.Menus.Add(menu0302);



            Menu menu04 = new Menu();
            menu04.MenuID = Guid.NewGuid();
            menu04.Name = "企业管理器";
            menu04.IsValid = true;
            menu04.SortOrder = 2;
            menu04.ParentMenuID = Guid.Parse("00000000-0000-0000-0000-000000000000");
            menu04.IsValid = true;
            menu04.IsDeleted = false;
            menu04.IsValid = true;
            menu04.Remark = string.Empty;
            menu04.UpdatedAt = DateTime.Now;
            menu04.CreatedBy = "system";
            menu04.UpdatedBy = "system";
            context.Menus.Add(menu04);


            Menu menu0401 = new Menu();
            menu0401.MenuID = Guid.NewGuid();
            menu0401.Name = "组织机构";
            menu0401.ParentMenuID = menu04.MenuID;
            menu0401.Action = "Index";
            menu0401.Controller = "Department";
            menu0401.Ico = "icon-th-large";
            menu0401.IsValid = true;
            menu0401.IsValid = true;
            menu0401.IsDeleted = false;
            menu0401.IsValid = true;
            menu0401.Remark = string.Empty;
            menu0401.UpdatedAt = DateTime.Now;
            menu0401.CreatedBy = "system";
            menu0401.UpdatedBy = "system";
            context.Menus.Add(menu0401);

            Menu menu0402 = new Menu();
            menu0402.MenuID = Guid.NewGuid();
            menu0402.Name = "员工管理";
            menu0402.ParentMenuID = menu04.MenuID;
            menu0402.Action = "Index";
            menu0402.Controller = "Employee";
            menu0402.Ico = "icon icon-color icon-user";
            menu0402.IsDeleted = false;
            menu0402.IsValid = true;
            menu0402.Remark = string.Empty;
            menu0402.UpdatedAt = DateTime.Now;
            menu0402.CreatedBy = "system";
            menu0402.UpdatedBy = "system";
            context.Menus.Add(menu0402);


            Menu menu05 = new Menu();
            menu05.MenuID = Guid.NewGuid();
            menu05.Name = "生产管理";
            menu05.SortOrder = 3;
            menu05.ParentMenuID = Guid.Parse("00000000-0000-0000-0000-000000000000");
            menu05.IsDeleted = false;
            menu05.IsValid = true;
            menu05.Remark = string.Empty;
            menu05.UpdatedAt = DateTime.Now;
            menu05.CreatedBy = "system";
            menu05.UpdatedBy = "system";
            context.Menus.Add(menu05);


            Menu menu0501 = new Menu();
            menu0501.MenuID = Guid.NewGuid();
            menu0501.Name = "订单管理";
            menu0501.ParentMenuID = menu05.MenuID;
            menu0501.Action = "Index";
            menu0501.Controller = "Order";
            menu0501.Ico = "icon icon-color icon-messages";
            menu0501.IsDeleted = false;
            menu0501.IsValid = true;
            menu0501.Remark = string.Empty;
            menu0501.UpdatedAt = DateTime.Now;
            menu0501.CreatedBy = "system";
            menu0501.UpdatedBy = "system";
            context.Menus.Add(menu0501);


            Menu menu0502 = new Menu();
            menu0502.MenuID = Guid.NewGuid();
            menu0502.Name = "无扫描枪录入";
            menu0502.ParentMenuID = menu05.MenuID;
            menu0502.Action = "Index";
            menu0502.Controller = "NoScanInput";
            menu0502.Ico = "icon icon-color icon-cancel";
            menu0502.IsDeleted = false;
            menu0502.IsValid = true;
            menu0502.Remark = string.Empty;
            menu0502.UpdatedAt = DateTime.Now;
            menu0502.CreatedBy = "system";
            menu0502.UpdatedBy = "system";
            context.Menus.Add(menu0502);

            Menu menu0503 = new Menu();
            menu0503.MenuID = Guid.NewGuid();
            menu0503.Name = "扫描枪录入";
            menu0503.ParentMenuID = menu05.MenuID;
            menu0503.Action = "Index";
            menu0503.Controller = "ScanInput";
            menu0503.Ico = "icon icon-color icon-flag";
            menu0503.IsDeleted = false;
            menu0503.IsValid = true;
            menu0503.Remark = string.Empty;
            menu0503.UpdatedAt = DateTime.Now;
            menu0503.CreatedBy = "system";
            menu0503.UpdatedBy = "system";
            context.Menus.Add(menu0503);


            Menu menu06 = new Menu();
            menu06.MenuID = Guid.NewGuid();
            menu06.Name = "报表查询";
            menu06.SortOrder = 3;
            menu06.ParentMenuID = Guid.Parse("00000000-0000-0000-0000-000000000000");
            menu06.IsDeleted = false;
            menu06.IsValid = true;
            menu06.Remark = string.Empty;
            menu06.UpdatedAt = DateTime.Now;
            menu06.CreatedBy = "system";
            menu06.UpdatedBy = "system";
            context.Menus.Add(menu06);

            Menu menu0601 = new Menu();
            menu0601.MenuID = Guid.NewGuid();
            menu0601.Name = "计件工资报表";
            menu0601.ParentMenuID = menu06.MenuID;
            menu0601.Action = "Index";
            menu0601.Controller = "ScanInput";
            menu0601.Ico = "icon icon-color icon-page";
            menu0601.IsDeleted = false;
            menu0601.IsValid = true;
            menu0601.Remark = string.Empty;
            menu0601.UpdatedAt = DateTime.Now;
            menu0601.CreatedBy = "system";
            menu0601.UpdatedBy = "system";
            context.Menus.Add(menu0601);

            Menu menu0602 = new Menu();
            menu0602.MenuID = Guid.NewGuid();
            menu0602.Name = "工资总报表";
            menu0602.ParentMenuID = menu06.MenuID;
            menu0602.Action = "Index";
            menu0602.Controller = "ScanInput";
            menu0602.Ico = "icon icon-color icon-copy";
            menu0602.IsDeleted = false;
            menu0602.IsValid = true;
            menu0602.Remark = string.Empty;
            menu0602.UpdatedAt = DateTime.Now;
            menu0602.CreatedBy = "system";
            menu0602.UpdatedBy = "system";
            context.Menus.Add(menu0602);


            Menu menu0603 = new Menu();
            menu0603.MenuID = Guid.NewGuid();
            menu0603.Name = "生产进度表";
            menu0603.ParentMenuID = menu06.MenuID;
            menu0603.Action = "Index";
            menu0603.Controller = "ScanInput";
            menu0603.Ico = "icon icon-color icon-pdf";
            menu0603.IsDeleted = false;
            menu0603.IsValid = true;
            menu0603.Remark = string.Empty;
            menu0603.UpdatedAt = DateTime.Now;
            menu0603.CreatedBy = "system";
            menu0603.UpdatedBy = "system";
            context.Menus.Add(menu0603);

            #endregion

            #region 客户初始化


            Customer customer = new Customer();

            customer.CustomerID = Guid.NewGuid();
            customer.NO = "CUST20131020001";
            customer.CN_Name = "霍尼韦尔综合科技有限公司";
            customer.Region = "华东地区";
            customer.City = "上海";
            customer.Tel = "021-23421234";
            customer.ContactPerson = "Jason Zhou";
            customer.IsDeleted = false;
            customer.IsValid = true;
            customer.Remark = string.Empty;
            customer.UpdatedAt = DateTime.Now;
            customer.CreatedBy = "system";
            customer.UpdatedBy = "system";
            context.Customers.Add(customer);

            #endregion

            #region 款式类型
            StyleCategory styleCategory1 = new StyleCategory();
            styleCategory1.StyleCategoryID = Guid.NewGuid();
            styleCategory1.Name = "男童装上装";
            styleCategory1.Description = "童装";
            styleCategory1.IsDeleted = false;
            styleCategory1.IsValid = true;
            styleCategory1.Remark = string.Empty;
            styleCategory1.UpdatedAt = DateTime.Now;
            styleCategory1.CreatedBy = "system";
            styleCategory1.UpdatedBy = "system";
            context.StyleCategories.Add(styleCategory1);

            StyleCategory styleCategory2 = new StyleCategory();
            styleCategory2.StyleCategoryID = Guid.NewGuid();
            styleCategory2.Name = "男童装下装";
            styleCategory2.Description = "童装";
            styleCategory2.IsDeleted = false;
            styleCategory2.IsValid = true;
            styleCategory2.Remark = string.Empty;
            styleCategory2.UpdatedAt = DateTime.Now;
            styleCategory2.CreatedBy = "system";
            styleCategory2.UpdatedBy = "system";
            context.StyleCategories.Add(styleCategory2);


            StyleCategory styleCategory3 = new StyleCategory();
            styleCategory3.StyleCategoryID = Guid.NewGuid();
            styleCategory3.Name = "女童装上装";
            styleCategory3.Description = "童装";
            styleCategory3.IsDeleted = false;
            styleCategory3.IsValid = true;
            styleCategory3.Remark = string.Empty;
            styleCategory3.UpdatedAt = DateTime.Now;
            styleCategory3.CreatedBy = "system";
            styleCategory3.UpdatedBy = "system";
            context.StyleCategories.Add(styleCategory3);

            StyleCategory styleCategory4= new StyleCategory();
            styleCategory4.StyleCategoryID = Guid.NewGuid();
            styleCategory4.Name = "女童装下装";
            styleCategory4.Description = "童装";
            styleCategory4.IsDeleted = false;
            styleCategory4.IsValid = true;
            styleCategory4.Remark = string.Empty;
            styleCategory4.UpdatedAt = DateTime.Now;
            styleCategory4.CreatedBy = "system";
            styleCategory4.UpdatedBy = "system";
            context.StyleCategories.Add(styleCategory4);


            StyleCategory styleCategory5 = new StyleCategory();
            styleCategory5.StyleCategoryID = Guid.NewGuid();
            styleCategory5.Name = "男装上装";
            styleCategory5.Description = "男装";
            styleCategory5.IsDeleted = false;
            styleCategory5.IsValid = true;
            styleCategory5.Remark = string.Empty;
            styleCategory5.UpdatedAt = DateTime.Now;
            styleCategory5.CreatedBy = "system";
            styleCategory5.UpdatedBy = "system";
            context.StyleCategories.Add(styleCategory5);

            StyleCategory styleCategory6 = new StyleCategory();
            styleCategory6.StyleCategoryID = Guid.NewGuid();
            styleCategory6.Name = "男装下装";
            styleCategory6.Description = "男装";
            styleCategory6.IsDeleted = false;
            styleCategory6.IsValid = true;
            styleCategory6.Remark = string.Empty;
            styleCategory6.UpdatedAt = DateTime.Now;
            styleCategory6.CreatedBy = "system";
            styleCategory6.UpdatedBy = "system";
            context.StyleCategories.Add(styleCategory6);


            StyleCategory styleCategory7 = new StyleCategory();
            styleCategory7.StyleCategoryID = Guid.NewGuid();
            styleCategory7.Name = "女装上装";
            styleCategory7.Description = "女装";
            styleCategory7.IsDeleted = false;
            styleCategory7.IsValid = true;
            styleCategory7.Remark = string.Empty;
            styleCategory7.UpdatedAt = DateTime.Now;
            styleCategory7.CreatedBy = "system";
            styleCategory7.UpdatedBy = "system";
            context.StyleCategories.Add(styleCategory7);

            StyleCategory styleCategory8 = new StyleCategory();
            styleCategory8.StyleCategoryID = Guid.NewGuid();
            styleCategory8.Name = "女装下装";
            styleCategory8.Description = "女装";
            styleCategory8.IsDeleted = false;
            styleCategory8.IsValid = true;
            styleCategory8.Remark = string.Empty;
            styleCategory8.UpdatedAt = DateTime.Now;
            styleCategory8.CreatedBy = "system";
            styleCategory8.UpdatedBy = "system";
            context.StyleCategories.Add(styleCategory8);

            #endregion

            #region 基础款式
            Style style1 = new Style();
            style1.StyleCategoryID = styleCategory5.StyleCategoryID;
            style1.StyleID = Guid.NewGuid();
            style1.StyleNo = "S001";
            style1.Name = "男士西装";
            style1.Description = "西装";
            style1.IsDeleted = false;
            style1.IsValid = true;
            style1.Remark = string.Empty;
            style1.UpdatedAt = DateTime.Now;
            style1.CreatedBy = "system";
            style1.UpdatedBy = "system";
            context.Styles.Add(style1);

            #endregion          

            #region 尺码初始化
            Size size = new Size();
            size.SizeID = Guid.NewGuid();
            size.Name = "S";
            size.Description = "小码";
            size.IsDeleted = false;
            size.IsValid = true;
            size.Remark = string.Empty;
            size.UpdatedAt = DateTime.Now;
            size.CreatedBy = "system";
            size.UpdatedBy = "system";
            context.Sizes.Add(size);

            Size size1 = new Size();
            size1.SizeID = Guid.NewGuid();
            size1.Name = "XS";
            size1.Description = "特小码";
            size1.IsDeleted = false;
            size1.IsValid = true;
            size1.Remark = string.Empty;
            size1.UpdatedAt = DateTime.Now;
            size1.CreatedBy = "system";
            size1.UpdatedBy = "system";
            context.Sizes.Add(size1);


            Size size2 = new Size();
            size2.SizeID = Guid.NewGuid();
            size2.Name = "M";
            size2.Description = "特小码";
            size2.IsDeleted = false;
            size2.IsValid = true;
            size2.Remark = string.Empty;
            size2.UpdatedAt = DateTime.Now;
            size2.CreatedBy = "system";
            size2.UpdatedBy = "system";
            context.Sizes.Add(size2);


            Size size3 = new Size();
            size3.SizeID = Guid.NewGuid();
            size3.Name = "L";
            size3.Description = "大码";
            size3.IsDeleted = false;
            size3.IsValid = true;
            size3.Remark = string.Empty;
            size3.UpdatedAt = DateTime.Now;
            size3.CreatedBy = "system";
            size3.UpdatedBy = "system";
            context.Sizes.Add(size3);


            Size size4 = new Size();
            size4.SizeID = Guid.NewGuid();
            size4.Name = "XL";
            size4.Description = "大码";
            size4.IsDeleted = false;
            size4.IsValid = true;
            size4.Remark = string.Empty;
            size4.UpdatedAt = DateTime.Now;
            size4.CreatedBy = "system";
            size4.UpdatedBy = "system";
            context.Sizes.Add(size4);


            Size size5 = new Size();
            size5.SizeID = Guid.NewGuid();
            size5.Name = "XXL";
            size5.Description = "特大码";
            size5.IsDeleted = false;
            size5.IsValid = true;
            size5.Remark = string.Empty;
            size5.UpdatedAt = DateTime.Now;
            size5.CreatedBy = "system";
            size5.UpdatedBy = "system";
            context.Sizes.Add(size5);

            #endregion

            #region 单位初始化
            Unit unit = new Unit();
            unit.UnitID = Guid.NewGuid();
            unit.Name = "双";
            unit.Description = "鞋子，袜子，手套等的尺码";
            unit.IsDeleted = false;
            unit.IsValid = true;
            unit.Remark = string.Empty;
            unit.UpdatedAt = DateTime.Now;
            unit.CreatedBy = "system";
            unit.UpdatedBy = "system";
            context.Units.Add(unit);

            Unit unit2 = new Unit();
            unit2.UnitID = Guid.NewGuid();
            unit2.Name = "件";
            unit2.Description = "衣服的尺码";
            unit2.IsDeleted = false;
            unit2.IsValid = true;
            unit2.Remark = string.Empty;
            unit2.UpdatedAt = DateTime.Now;
            unit2.CreatedBy = "system";
            unit2.UpdatedBy = "system";
            context.Units.Add(unit2);

            Unit unit3 = new Unit();
            unit3.UnitID = Guid.NewGuid();
            unit3.Name = "条";
            unit3.Description = "裤子的尺码";
            unit3.IsDeleted = false;
            unit3.IsValid = true;
            unit3.Remark = string.Empty;
            unit3.UpdatedAt = DateTime.Now;
            unit3.CreatedBy = "system";
            unit3.UpdatedBy = "system";
            context.Units.Add(unit3);

            #endregion

            context.SaveChanges();
        }
    }
}
